<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""DTD/xhtml1-strict.dtd">
<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib uri="/WEB-INF/c.tld" prefix="c"%>
<%@taglib uri="/WEB-INF/fmt.tld" prefix="fmt"%>
<%@taglib uri="/WEB-INF/el.tld" prefix="el"%>
<%@taglib uri="/WEB-INF/fn.tld" prefix="fn"%>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
		<title></title>
		<c:import url="/includes/css_inc.jsp"/>
		<c:import url="/includes/js_inc.jsp"/>
		<script>
			$(function(){
				$("#add").button({
		            icons: {
		                primary: "ui-icon-plusthick"
		            }
		        }).click(function(){
		        	$("#listForm").submit();
		        });
				$("[name=editBtn]").button({
		            icons: {
		                primary: "ui-icon-pencil"
		            },
            		text: false
				});
				$("[name=managerBtn]").button({
		            icons: {
		                primary: "ui-icon-note"
		            },
            		text: false
				});
			});
		</script>
	</head>
	<body>
		<c:set var="auth" value="${el:getMapValue(menuAuth, 'ACC60101')}"/>
		<c:import url="/apps/msg.jsp"/>
		<form class="acc67-form" name="listForm" id="listForm" action="${pageContext.request.contextPath}/acc6" method="post">
		<input type="hidden" name="app" id="app" value="ACC60101"/>
		<input type="hidden" name="job" id="job" value="add"/>
		<table width="100%" class="ui-widget ui-widget-content" border="0">
			<tr>
				<th align="left" class="acc67-header ui-widget-header" colspan="2"><b>${screenCode.ACC60101}</b></th>
			</tr>
			<tr>
				<td colspan="2" align="right">
					<c:if test="${fn:contains(auth, 'I')}">
						<button id="add" type="button" class="acc67-button">เพิ่มข้อมูล</button>
					</c:if>
				</td>
			</tr>
		</table>
		<br/>
			<table width="100%" class="acc67-grid ui-widget ui-widget-content" border="0">
				<tr>
					<th align="center" class="ui-state-default" >ปีงบประมาณ</th>
					<th align="center" class="ui-state-default" width="9%">แก้ไขข้อมูล</th>
					<th align="center" class="ui-state-default" width="9%">จัดการรหัส</th>
				</tr>
				<c:if test="${!empty listData}">
					<c:forEach var="data" items="${listData}" varStatus="x">
						<tr class="grid-tr-${x.count % 2}">
							<td align="canter">${data.BUDGET_YEAR}</td>
							<td align="center">
								<c:if test="${fn:contains(auth, 'U')}">
									<button type="button" name="editBtn" id="editBtn" class="acc67-button" onclick="window.location='${pageContext.request.contextPath}/acc6?app=ACC60101&job=update&budgetYear=${data.BUDGET_YEAR}'"></button>
								</c:if>
							</td>
							<td align="center">
								<c:if test="${fn:contains(auth, 'U')}">
									<button type="button" name="managerBtn" id="managerBtn" class="acc67-button" onclick="window.location='${pageContext.request.contextPath}/acc6?app=ACC60101&job=manager&budgetYear=${data.BUDGET_YEAR}'"></button>
								</c:if>
							</td>
						</tr>
					</c:forEach>		
				</c:if>
				<c:if test="${empty listData}">	
					<td colspan="3" align="center"><p class="red">ไม่มีข้อมูล</p></td>
				</c:if>
			</table>
		</form>
	</body>
</html>